package com.sairobo.admin.modules.srblive.controller;

import java.util.Map;

import com.sairobo.base.common.entity.Page;
import com.sairobo.admin.modules.srblive.entity.SrbliveNews;
import com.sairobo.admin.modules.srblive.service.SrbliveNewsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.sairobo.base.modules.sys.controller.AbstractController;
import com.sairobo.base.common.entity.R;
import com.sairobo.base.common.annotation.SysLog;

/**
 * 客服消息表
 *
 * @author admin
 * @email sairobo
 * @url www.sairobo.com
 * @date 2018年1月11日 下午2:12:02
 */
@RestController
@RequestMapping("/srblive/news")
public class SrbliveNewsController extends AbstractController {
	
	@Autowired
	private SrbliveNewsService srbliveNewsService;
	
	/**
	 * 列表
	 * @param params
	 * @return
	 */
	@RequestMapping("/list")
	public Page<SrbliveNews> list(@RequestBody Map<String, Object> params) {
		return srbliveNewsService.listSrbliveNews(params);
	}
		
	/**
	 * 新增
	 * @param srbliveNews
	 * @return
	 */
	@SysLog("新增客服消息表")
	@RequestMapping("/save")
	public R save(@RequestBody SrbliveNews srbliveNews) {
		return srbliveNewsService.saveSrbliveNews(srbliveNews);
	}
	
	/**
	 * 根据id查询详情
	 * @param id
	 * @return
	 */
	@RequestMapping("/info")
	public R getById(@RequestBody Long id) {
		return srbliveNewsService.getSrbliveNewsById(id);
	}
	
	/**
	 * 修改
	 * @param srbliveNews
	 * @return
	 */
	@SysLog("修改客服消息表")
	@RequestMapping("/update")
	public R update(@RequestBody SrbliveNews srbliveNews) {
		return srbliveNewsService.updateSrbliveNews(srbliveNews);
	}
	
	/**
	 * 删除
	 * @param id
	 * @return
	 */
	@SysLog("删除客服消息表")
	@RequestMapping("/remove")
	public R batchRemove(@RequestBody Long[] id) {
		return srbliveNewsService.batchRemove(id);
	}
	
}
